#ifndef AGT_LOGGER_H
#define AGT_LOGGER_H

#define LOGGER_ERROR 0x01
#define LOGGER_WARNING 0x02
#define LOGGER_INFO 0x03

#include <iostream>
#include <fstream>

namespace agtk {

/** A helpful class (IMO) for simplifying logfiles a little.
	@author Tom Savage
**/
class Logger
{
public:
	/** Logger constructor. Opens file stream and creates the logfile if it doesn't exist yet.
		@param filename Relative/absolute path to the logfile you which to use. Does not need to exist yet.
	**/
	Logger(char* filename);

	/** Logger destructor. Calls fclose for you. **/
	~Logger(void);

	/** Log a message line w/ carrage return.
		@param type The type of message you wish to log. E.g. "LOGGER_ERROR".
		@param msg The message you wish to log.
		@param extra A param where extra information can be put to be displayed. Useful for SDL_GetError() or file names.
	**/
	void Log(int type, char* msg, char* extra = "");

private:
	/** File stream for the logfile. **/
	FILE *m_fLogfile;
};

}

#endif